package com.iterator.self;

import java.util.Iterator;

public class InfoCompany implements Company{

    private Sector [] sectors;

    private int index=0;

    public InfoCompany() {
        sectors = new Sector[5];
        addSector("信息安全","信息安全");
        addSector("数据安全","数据安全");
        addSector("信息处理","信息处理");
        addSector("信息技术","信息技术");
        addSector("数据技术","数据技术");
    }

    @Override
    public String getName() {
        return "信息公司";
    }

    @Override
    public void addSector(String name,String desc) {
        sectors[index]=new Sector(name, desc);
        index++;
    }

    @Override
    public Iterator getIterator() {
        return new InfoCompanyIterator(sectors);
    }
}
